package com.cloud.spi;



import com.cloud.spi.interf.TestInterface;

import java.util.Iterator;
import java.util.ServiceLoader;

public class Main {
    public static void main(String[] args) throws ClassNotFoundException {
        ServiceLoader<TestInterface> load = ServiceLoader.load(TestInterface.class);
        System.out.println(load);
        Iterator<TestInterface> iterator = load.iterator();
        while (iterator.hasNext()) {
            TestInterface next = iterator.next();
            next.show();
        }
    }
}
